package com.unisal.java;

public class MenuJantarIterator implements Iterator {

	ItemDoMenu[] itens;
	Integer posicao = 0;

	public MenuJantarIterator(ItemDoMenu[] itens) {
		this.itens = itens;
	}

	@Override
	public boolean hasNext() {
		if (posicao >= itens.length || itens[posicao] == null) {
			return false;
		} else {
			return true;
		}
	}

	@Override
	public Object next() {
		ItemDoMenu itemDoMenu = itens[posicao];
		posicao += 1;
		return itemDoMenu;
	}

}
